Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Archiver and add BaseHead #139

Merged
merged 24 commits into from
Nov 28, 2024
Merged

Refactor Archiver and add BaseHead #139

merged 24 commits into from
Nov 28, 2024

Conversation

sokovninn
Copy link
Member

@sokovninn sokovninn commented Nov 26, 2024

This PR introduces the BaseHead class to standardize head definitions in the NN architecture. The new class enforces required fields like parser and provides a structured way to define head-specific metadata via get_custom_head_config.

Additionally, the archiver has been refactored to utilize the BaseHead class for generating configurations, reducing redundancy and improving scalability when adding new architectures. This ensures auxiliary heads and other metadata are handled consistently.

Key Changes:

  • Added BaseHead class with a parser field.
  • Introduced _get_base_head_config and get_custom_head_config for better separation of base and custom logic.
  • Updated the archiver to use BaseHead instances instead of relying solely on the config file.
  • Improved error handling for missing or invalid head configurations.

@github-actions github-actions bot added the enhancement New feature or request label Nov 26, 2024
@sokovninn
Copy link
Member Author

I've updated only the EfficientBBoxHead to showcase the new logic. I will extend it to other classes once it's approved.

luxonis_train/nodes/heads/base_head.py Outdated Show resolved Hide resolved
luxonis_train/nodes/heads/base_head.py Outdated Show resolved Hide resolved
@sokovninn sokovninn changed the title [DRAFT] Refactor Archiver Refactor Archiver and add BaseHead Nov 27, 2024
@sokovninn sokovninn marked this pull request as ready for review November 27, 2024 14:44
@sokovninn sokovninn requested a review from a team as a code owner November 27, 2024 14:44
@sokovninn sokovninn requested review from kozlov721, klemen1999, tersekmatija and conorsim and removed request for a team November 27, 2024 14:44
Copy link
Collaborator

@klemen1999 klemen1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, we just need to ensure that the end archives can be seamlessly then used with parsers in dai-nodes

klemen1999

This comment was marked as duplicate.

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.14%. Comparing base (631b905) to head (d2a05f4).
Report is 19 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #139      +/-   ##
==========================================
- Coverage   96.31%   95.14%   -1.18%     
==========================================
  Files         147      164      +17     
  Lines        6304     7144     +840     
==========================================
+ Hits         6072     6797     +725     
- Misses        232      347     +115     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@kozlov721 kozlov721 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left some small comments

luxonis_train/nodes/heads/base_head.py Outdated Show resolved Hide resolved
luxonis_train/nodes/heads/base_head.py Outdated Show resolved Hide resolved
luxonis_train/utils/general.py Outdated Show resolved Hide resolved
@sokovninn sokovninn merged commit 2861873 into main Nov 28, 2024
8 of 9 checks passed
@sokovninn sokovninn deleted the feat/archiver-refactor branch November 28, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants